import django_filters
from .models import *

class RecordIncomesFilter(django_filters.rest_framework.FilterSet):
    """过滤器"""

    userCode = django_filters.CharFilter(field_name='user__code')
    orderId = django_filters.CharFilter(lookup_expr='icontains')
    startTime = django_filters.DateFilter(field_name='createTime', help_text="开始时间", lookup_expr='gte')
    endTime = django_filters.DateFilter(field_name='createTime', help_text="结束时间", lookup_expr='lte')

    class Meta:
        model = RecordIncomes
        fields = '__all__'